package com.tingfeng.xiuzhen.qq;

import android.util.Log;

import com.tencent.tauth.IUiListener;
import com.tencent.tauth.UiError;
import com.tingfeng.xiuzhen.GlobalData;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by zhangtao on 2018/5/16.
 */

public class BaseUiListener implements IUiListener {

    @Override
    public void onComplete(Object response) {
        Log.d(GlobalData.TAG, "qq_BaseUiListener_onComplete: " + response.toString());
        try {
            doComplete((JSONObject) response);
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }

    protected void doComplete(JSONObject values) throws JSONException {
        Log.e(GlobalData.TAG, "qq_BaseUiListener_doComplete: " + values);
    }

    @Override
    public void onError(UiError e) {
        Log.e(GlobalData.TAG, "qq_BaseUiListener_onCancel: " + e.errorDetail);
    }

    @Override
    public void onCancel() {
        Log.e(GlobalData.TAG, "qq_BaseUiListener_onCancel: ");
    }
}